﻿using System;
namespace BestCode.Creds.UI.Config
{
    public class AppSettingConfig
    {
        public string DefaultOutputFolder { get; set; }
        public string DefaultPrinterName { get; set; }
        public bool CanResizeQRCode { get; set; }
    }


    public class ConfigReader
    {
        private static ConfigReader instance = null;

        public static ConfigReader Current
        {
            get
            {
                if (instance == null)
                    return new ConfigReader();
                return instance;
            }
        }


        public ConfigReader()
        {
            Config = new AppSettingConfig();
            Config.DefaultOutputFolder = System.Configuration.ConfigurationManager.AppSettings["DefaultOutputFolder"];
            Config.DefaultPrinterName = System.Configuration.ConfigurationManager.AppSettings["DefaultPrinterName"];
            Config.CanResizeQRCode = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["CanResizeQRCode"]);
 
        }

        public AppSettingConfig Config { get; private set; }


    }
}
